/*****************************************
                                i2c.h
                                zhangtaolei     2016-1-27
******************************************/
#ifndef _I2C_H_
#define _I2C_H_

/*****************************************
                                include
******************************************/
#include "stm8s_conf.h"

/*****************************************
                                macro
******************************************/


/*****************************************
                                typedef
******************************************/


/*****************************************
                                variables
******************************************/

/*****************************************
                                function
******************************************/
void I2C__Init();
uint8_t I2C_Read(uint8_t slaveAddr, uint8_t regAddr, uint8_t *buf, uint16_t len);
uint8_t I2C_Write(uint8_t slaveAddr, uint8_t regAddr, uint8_t *buf, uint16_t len);
uint8_t I2C_Read_16(uint8_t slaveAddr, uint16_t regAddr, uint8_t *buf, uint16_t len);
uint8_t I2C_Write_16(uint8_t slaveAddr, uint16_t regAddr, uint8_t *buf, uint16_t len);


#endif

